<?php

require_once'db_conn.php';
header("content-type:text/html.charset=utf_8");
$id = $_POST['id'];
$id = intval($id);

$username = $_POST['username'];
$sex = $_POST['sex'];
$message = $POST['message'];
$imgurl = $_POST['imgurl'];
$time_at = time();

$sql = "
UPDATE 'ahh'.'t_message'
SET
'username' = '$username',
'sex' = 'sex',
'content' = '$message',
'avater' = '$imgurl',
'time_at' = '$time_at'
WHERE 't_message'.'id' = $id;
  ";

$result = $corum->query($sql);
if($result>0){
    header("Location:index2.php");
}
